/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.buanalintas.sandals.pos.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author tebet1
 */
@Entity
@Table(name = "pos_master_franchise")
@XmlRootElement
//@NamedQueries({
//    @NamedQuery(name = "PosMasterFranchise.findAll", query = "SELECT t FROM PosMasterFranchise t"),
//    @NamedQuery(name = "PosMasterFranchise.findBySync", query = "SELECT t FROM PosMasterFranchise t WHERE t.sync = :sync"),
//    @NamedQuery(name = "PosMasterFranchise.findByFranchiseId", query = "SELECT t FROM PosMasterFranchise t WHERE t.franchiseId = :franchiseId"),
//    @NamedQuery(name = "PosMasterFranchise.findByFranchiseCode", query = "SELECT t FROM PosMasterFranchise t WHERE t.franchiseCode = :franchiseCode"),
//    @NamedQuery(name = "PosMasterFranchise.findByFranchiseName", query = "SELECT t FROM PosMasterFranchise t WHERE t.franchiseName = :franchiseName"),
//    @NamedQuery(name = "PosMasterFranchise.findByFranchiseAddress", query = "SELECT t FROM PosMasterFranchise t WHERE t.franchiseAddress = :franchiseAddress"),
//    @NamedQuery(name = "PosMasterFranchise.findByFranchisePhone", query = "SELECT t FROM PosMasterFranchise t WHERE t.franchisePhone = :franchisePhone"),
//    @NamedQuery(name = "PosMasterFranchise.findByFranchiseContact", query = "SELECT t FROM PosMasterFranchise t WHERE t.franchiseContact = :franchiseContact")})
public class PosMasterFranchise implements Serializable {

    private static final long serialVersionUID = 1L;
    @Column(name = "sync")
    private String sync;
    @Id
    @Basic(optional = false)
    @Column(name = "franchise_id")
    private Integer franchiseId;
    @Column(name = "franchise_code")
    private String franchiseCode;
    @Column(name = "franchise_name")
    private String franchiseName;
    @Column(name = "franchise_address")
    private String franchiseAddress;
    @Column(name = "franchise_phone")
    private String franchisePhone;
    @Column(name = "franchise_contact")
    private String franchiseContact;

    public PosMasterFranchise() {
    }

    public PosMasterFranchise(Integer franchiseId) {
        this.franchiseId = franchiseId;
    }

    public String getSync() {
        return sync;
    }

    public void setSync(String sync) {
        this.sync = sync;
    }

    public Integer getFranchiseId() {
        return franchiseId;
    }

    public void setFranchiseId(Integer franchiseId) {
        this.franchiseId = franchiseId;
    }

    public String getFranchiseCode() {
        return franchiseCode;
    }

    public void setFranchiseCode(String franchiseCode) {
        this.franchiseCode = franchiseCode;
    }

    public String getFranchiseName() {
        return franchiseName;
    }

    public void setFranchiseName(String franchiseName) {
        this.franchiseName = franchiseName;
    }

    public String getFranchiseAddress() {
        return franchiseAddress;
    }

    public void setFranchiseAddress(String franchiseAddress) {
        this.franchiseAddress = franchiseAddress;
    }

    public String getFranchisePhone() {
        return franchisePhone;
    }

    public void setFranchisePhone(String franchisePhone) {
        this.franchisePhone = franchisePhone;
    }

    public String getFranchiseContact() {
        return franchiseContact;
    }

    public void setFranchiseContact(String franchiseContact) {
        this.franchiseContact = franchiseContact;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (franchiseId != null ? franchiseId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PosMasterFranchise)) {
            return false;
        }
        PosMasterFranchise other = (PosMasterFranchise) object;
        if ((this.franchiseId == null && other.franchiseId != null) || (this.franchiseId != null && !this.franchiseId.equals(other.franchiseId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        //return "com.buanalintas.sandals.pos.entities.PosMasterFranchise[ franchiseId=" + franchiseId + " ]";
        return franchiseName;
    }
}
